<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
$tabs=array(
	array('op'=>'get','title'=>'余额支付'),
);
$jy_paypal = check_permission('jy_paypal');
if($jy_paypal){
	$tabs[]=array('action'=>'jy_paypal/index/','title'=>'PayPal境外支付');
}
$jy_stripe = check_permission('jy_stripe');
if($jy_stripe){
	$tabs[]=array('action'=>'jy_stripe/index/','title'=>'Stripe跨境支付');
}
$jy_asiabill = check_permission('jy_asiabill');
if($jy_asiabill){
	$tabs[]=array('action'=>'jy_asiabill/index/','title'=>'AsiaBill跨境支付');
}
$jy_pingpong = check_permission('jy_pingpong');
if($jy_pingpong){
	$tabs[]=array('action'=>'jy_pingpong/index/','title'=>'PingPong跨境支付');
}
$jy_onerway = check_permission('jy_onerway');
if($jy_onerway){
	$tabs[]=array('action'=>'jy_onerway/index/','title'=>'Onerway境外支付');
}
$jy_wintopay = check_permission('jy_wintopay');
if($jy_wintopay){
	$tabs[]=array('action'=>'jy_wintopay/index/','title'=>'WinToPay全球支付');
}
if($_RQ['op']=='get'){
	$item=uni_setting('pay_en');
	$return['item']=$item?$item:array();
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'余额支付',
		'tabs'=>$tabs,
		'edit'=>array(
			array('type'=>'switch','title'=>'货到付款','name'=>'hdfk'),
					array('type'=>'switch','title'=>'余额支付','name'=>'credit','help'=>'关闭余额支付时，充值功能也将关闭！'),
					array('type'=>'switch','title'=>'余额支持转账？','name'=>'credit2_zhuan'),
					array('type'=>'array_simple','title'=>'余额充值赠送设置','name'=>'credit_activitys','fields'=>array(
						array('type'=>'string','name'=>'condition','title'=>'充值金额（元）'),
						array('type'=>'string','name'=>'money','title'=>'赠送金额（元）'),
					)),
		)
	);
	$return['ismust']=array(0=>'非必填',1=>'必填');
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	uni_setting('pay_en',$postdata);
	exi('设置成功！');
}